import axios from '@/libs/axios.js'
import baseUrl from './index'
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' }

// Flow列表
export const getFlowData = (query) => {
  return axios({
    url: `${baseUrl}/resource-manager/playbackLib`,
    method: 'get',
    params: query,
    headers: jsonHeaders,
  })
}

//创建Flow
export const createFlow = (params) => {
  return axios({
    method: 'post',
    url: `${baseUrl}/resource-manager/playbackLib/insert`,
    data: JSON.stringify(params),
    headers: jsonHeaders,
  })
}

// 修改
export const modifyFlow = (params, id) => {
  return axios({
    url: `${baseUrl}/resource-manager/playbackLib/update/${id}`,
    method: 'put',
    data: JSON.stringify(params),
    headers: jsonHeaders,
  })
}
// 删除
export const delFlow = (id) => {
  return axios({
    url: `${baseUrl}/resource-manager/playbackLib/${id}`,
    method: 'delete',
    headers: {
      'content-type': 'application/x-www-form-urlencoded'
    },
  })
}